<?php $usuario = $usuario[0]; sleep(0.5);?>
<?php if(!isset($dicas['print'])){
        foreach ($dicas as $dica) :  ?>       
    
            <div id="dica">
                
                <div class="avatar">
                    <?php if($usuario->avatar) { 
                        $imgConf = array('src' => 'upload/thumbs/' . $usuario->avatar, 'alt' => $usuario->username, 'title' => $usuario->username, 'width' => '60', 'height' => '60');
                        echo anchor('usuario/profile/' . $usuario->idUsuario, img($imgConf)) ; ?>
                    <?php }else{?>
                        <?php echo anchor('usuario/profile/' . $usuario->idUsuario, img(array('src' => 'img/default_avatar.gif', 'alt' => $usuario->username, 'title' => $usuario->username, 'width' => '60', 'height' => '60'))); ?>
                    <?php } ?>
                </div>
                
                <div class="descricao">
                    <h5 class="name">Sua dica :: <?php echo $dica['tempo']; ?></h5>
                    <p><?php echo anchor('/dica/index/' . $dica[0]->idDica . '/' . $usuario->idUsuario , $dica[0]->descricao); ?></p>
                </div>
                
                 <div class="compartilhar">
                     <?php $url = 'dica/Legal/' . $dica[0]->idDica . '/' . $usuario->idUsuario;  $icon = "16"; ?>
                     <ul>
                        <li><a id="Legal<?php echo $dica[0]->idDica; ?>" href="javascript:void[0];" onclick="abrirPag('<?php echo base_url(); ?>index.php/dica/legal/<?php echo $dica[0]->idDica . '/' . $usuario->idUsuario; ?>', 'Legal<?php echo $dica[0]->idDica; ?>');" ><?php echo img(array('src' => 'img/icon-acoes/like.png','alt' => $dica['countLegal'], 'width' => $icon , 'height' => $icon ,'title' => $dica['countLegal'])); ?></a></li>
                        <li><a id="Vou<?php echo $dica[0]->idDica; ?>" href="javascript:void[0];" onclick="abrirPag('<?php echo base_url(); ?>index.php/dica/euVou/<?php echo $dica[0]->idDica . '/' . $usuario->idUsuario; ?>', 'Vou<?php echo $dica[0]->idDica; ?>');" ><?php echo img(array('src' => 'img/icon-acoes/go.png','alt' => $dica['countVou'], 'width' => $icon , 'height' => $icon, 'title' => $dica['countVou'])); ?></a></li>
                        <li><?php echo anchor('dica/mural/' . $dica[0]->idDica . '/' . $usuario->idUsuario, img(array('src' => 'img/icon-acoes/mural.png','alt' => "Mural", 'width' => $icon, 'height' => $icon, 'title' => "Mural"))) ?></li>
                        <li><a href="javascript: void [0]" onclick="<?php echo "javascript:toggle('" . $dica[0]->idDica . "')";?>"><?php echo img(array('src' => 'img/icon-acoes/share.png','alt' => "Compartilhar", 'width' => $icon , 'height' => $icon, 'title' => "Compartilhar")); ?></a></li>
                     </ul>
                </div>

                <div id="<?php echo $dica[0]->idDica;?>" class="redes_sociais" >
                <?php $imgFacebook  = array('src' => 'img/facebook.png', 'alt' => 'Facebook', 'title' => 'Facebook', 'width' => '30', 'height' => '30'); 
                       $imgTwitter = array('src' => 'img/twitter.png', 'alt' => 'Twitter', 'title' => 'Twitter', 'width' => '30', 'height' => '30');
                       $url = urlencode(base_url() . "index.php/dica/index/" . $dica[0]->idDica . "/" . $usuario->idUsuario);?>
                       <a href="javascript: void[0]" onclick="window.open('http://www.facebook.com/share.php?u=<?php echo $url?>','ventanacompartir', 'toolbar=0, status=0, width=650, height=450');"><?php echo img($imgFacebook); ?></a>
                       <a href="javascript: void[0]" onclick="window.open('http://twitter.com/share?text=<?php echo substr($dica[0]->descricao, 0, 99); ?> on Hintweek','ventanacompartir', 'toolbar=0, status=0, width=650, height=450');" class="twitter-share-text" data-url="<?php echo $url; ?>"><?php echo img($imgTwitter);?></a>
                </div>
            </div>
            
    <?php endforeach;

    }
    else
    {
       echo $dicas['print'];
    }?>